/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.jims.master.modules.sync.service;


import com.jims.master.common.persistence.Page;
import com.jims.master.common.service.CrudService;
import com.jims.master.common.utils.StringUtils;
import com.jims.master.modules.sync.dao.PatientDateListDao;
import com.jims.master.modules.sync.entity.PatientDateList;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * 就诊记录时间轴Service
 * @author xueyx
 * @version 2017-12-02
 */
@Service
@Transactional(readOnly = true)
public class PatientDateListService extends CrudService<PatientDateListDao, PatientDateList> {

	@Override
    public PatientDateList get(String id) {
		return super.get(id);
	}

    public Page<PatientDateList> findList(Page<PatientDateList> page,  Map map) {
		page.setPageNo(Integer.parseInt((String) map.get("pageNo")));
		if(StringUtils.isNotBlank((String) map.get("pageSize"))){
			page.setPageSize(Integer.parseInt((String) map.get("pageSize")));
		}else{
			page.setPageSize(10);
		}
		PatientDateList patientDateList = (PatientDateList) map.get("patientDateList");
		patientDateList.setPage(page);
		page.setList(super.findList(patientDateList));
		return page;
	}
	
	@Override
    public Page<PatientDateList> findPage(Page<PatientDateList> page, PatientDateList patientDateList) {
		return super.findPage(page, patientDateList);
	}
}